//
//  LGSSplitter.m
//  LogicSim
//
//  Created by Jeremy Pereira on 05/04/2012.
//  Copyright (c) 2012 Jeremy Pereira. All rights reserved.
//

#import "LGSSplitter.h"
#import "LGSEdge.h"
#import "LGSName.h"

@implementation LGSSplitter

-(void) evaluateAffectedNodes: (NSMutableOrderedSet*) affectedNodes;
{
    bool result = false;
    LGSEdge* input = [self input: [[self class] inputName]];
    result = [input value];

    NSSet* outputs = [self outputsForName: [[self class] outputName]];
    for (LGSEdge* output in outputs)
    {
        [output setValue: result affectedNodes: affectedNodes];
    }
}

-(TimeTick) gateDelay
{
    return 0;
}

+(NSArray*) defaultInputNames
{
    return @[[LGSName nameWithConnectionString: @"in"]];
}

+(NSArray*) defaultOutputNames
{
    return @[[LGSName nameWithConnectionString: @"out"]];
}


@end
